# -- coding: utf-8 -- 
# Name: 1_4_finding_service_name

import socket

def find_serv_name():
    protocol = 'tcp'
    for p in [80,25]:
        serv_name = socket.getservbyport(p,protocol)
        print "port: {}, service name: {}".format(p,serv_name)
    udpinfo = socket.getservbyport(53,'udp')
    print "port: {}, service name: {}".format(53, udpinfo)